package com.ecloud.common.data.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.ecloud.common.data.dynamic.DynamicDataSource;

/**
 * 动态数据源注解
 *
 * @author LiuGangQiang Create in 2021/04/26
 */
@Inherited
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
public @interface DynamicDS {
    /**
     * 数据源: 支持请求参数解析,支持SpEL表达式,支持固定数据源<br>
     * 默认值: {@value DynamicDataSource#MASTER} <br>
     * 优先级: header > session > paramter > spel
     *
     * @author LiuGangQiang Create in 2021/04/29
     * @return {@link String}
     */
    String value() default DynamicDataSource.MASTER;
}
